import { http } from "@/utils/http";
import { Result, arrayResult } from "../types";
import { exportExcel } from '@/utils/exportExcel'

type data = {
    agvid?: number,
    agvname?: string,
    ip?: string,
    model?: string,
    status?: number,
    vehicletype?: number,
    note?: string
};

type search = {
    code: string,
    content: string,
    recordtype: string,
    agvid: number,
    dateRange?: any,
    begin: string,
    end: string,
    pageNumber: number,
    pageSize: number,
    sortName: string,
    sortType: number
}

// 告警列表
export const recordList = (params?: search) => {
    return http.request<Result>("get", "/api/record/List", { params });
};

// 导出告警列表
export function excelRacklocations(data, fileName) {
    exportExcel('/api/record/Excel', data, fileName);
}
